Learn R Programming

pbdDMAT (version 0.2-3)

QR Decomposition: QR Decomposition Methods

Description

qr() takes the QR decomposition.

qr.Q() recovers Q from the output of qr(). qr.R() recovers R from the output of qr(). qr.qy() multiplies y by Q. qr.qty() multiplies y by the transpose of Q.

Usage

## S3 method for class 'ddmatrix':
qr(x, tol = 1e-07)
## S3 method for class 'ANY':
qr.Q(x, complete = FALSE,  Dvec = rep.int(if (cmplx) 1 + 
(0+0i) else 1, if (complete) dqr[1] else min(dqr)))
## S3 method for class 'ANY':
qr.R(x, complete = FALSE)
## S3 method for class 'ANY':
qr.qy(x, y)
## S3 method for class 'ANY':
qr.qty(x, y)

Arguments

x, y
numeric distributed matrices for qr(). Otherwise, x is a list, namely the return from qr().
tol
logical value, determines whether or not columns are zero centered.
complete
logical expression of length 1. Indicates whether an arbitrary orthogonal completion of the Q or X matrices is to be made, or whether the R matrix is to be completed by binding zero-value rows beneath the square upper triangle.
Dvec
Not implemented for objects of class ddmatrix. vector (not matrix) of diagonal values. Each column of the returned Q will be multiplied by the corresponding diagonal value. Defaults to all 1's.

Value

  • qr() returns a list consisting of: qr - rank - calculated numerical rank, tau - pivot - "class" - attribute "qr".

Details

Functions for forming a QR decomposition and for using the outputs of these numerical QR routines.

See Also

lm.fit

Examples

Run this code
# Save code in a file "demo.r" and run with 2 processors by
# > mpiexec -np 2 Rscript demo.r

library(pbdDMAT, quiet = TRUE)
init.grid()

# don't do this in production code
x <- matrix(1:9, 3)
x <- as.ddmatrix(x)

Q <- qr.Q(qr(x))
print(Q)

finalize()

Run the code above in your browser using DataLab